<template>
	<view>
		<view class="supplychain">
			<view class="item">
				<!-- <view class="acea-row row-middle row-between top-info">
					<view>3天内更新</view>
					<view class="close">×</view>
				</view> -->
				<view class="acea-row row-middle row-between sell-goods">
					<view class="goods-img">
						<image src="" mode="" class="img"></image>
						<view class="tag line1">
							好货上新
						</view>
						<!-- <view class="acea-row row-middle distance">
							<image src="@/static/images/location.png" mode=""></image>
							<text>距您1.4km</text>
						</view> -->
					</view>
					<view class="acea-row row-column-between goods-info">
						<view class="title line2">
							飘柔 | 洗发水 | 10套
						</view>
						<view class="sell-price">
							售价：<text>1200</text>元
						</view>
						<view class="gold-coin">
							<image src="@/static/images/goldcoin_icon.png" mode=""></image>
							<view class="num">25800</view>
						</view>
						<view class="acea-row goods-tag">
							<view class="tag">关键词1</view>
							<view class="tag">关键词2</view>
						</view>

					</view>
				</view>

				<view class="acea-row row-middle row-between visit-box">
					<view class="visit-advtar-box">
						<view class="visit-advtar">
							<image src="@/static/images/f.png" mode="" v-for="(item,index) in visitInfo" :key="index"
								:style="{left: (30 * index) + 'rpx'}"></image>
						</view>
						<view class="visit-num">18288人浏览 已成功匹配12254人</view>
					</view>

					<view class="visit-l">
						<view class="visit-num">5866人咨询</view>
						<view class="visit-btn" @click="toConcat(item.contacts)">
							立即咨询
						</view>
					</view>
				</view>
			</view>
			<view class="item">
				<!-- <view class="acea-row row-middle row-between top-info">
					<view>1天内更新</view>
					<view class="close">×</view>
				</view> -->
				<view class="acea-row row-middle row-between sell-goods">
					<view class="goods-img">
						<image src="" mode="" class="img"></image>
						<view class="tag line1">
							好货上新
						</view>
						<!-- <view class="acea-row row-middle distance">
							<image src="@/static/images/location.png" mode=""></image>
							<text>距您1.4km</text>
						</view> -->
					</view>
					<view class="acea-row row-column-between goods-info">
						<view class="title line2">
							飘柔 | 洗发水 | 10套
						</view>
						<view class="sell-price">
							售价：<text>1200</text>元
						</view>
						<view class="gold-coin">
							<image src="@/static/images/goldcoin_icon.png" mode=""></image>
							<view class="num">25800</view>
						</view>
						<view class="acea-row goods-tag">
							<view class="tag">关键词1</view>
							<view class="tag">关键词2</view>
						</view>

					</view>
				</view>

				<view class="acea-row row-middle row-between visit-box">
					<view class="visit-advtar-box">
						<view class="visit-advtar">
							<image src="@/static/images/f.png" mode="" v-for="(item,index) in visitInfo" :key="index"
								:style="{left: (20 * index) + 'rpx'}"></image>
						</view>
						<view class="visit-num">18288人浏览 已成功匹配12254人</view>
					</view>

					<view class="visit-l">
						<view class="visit-num">5866人咨询</view>
						<view class="visit-btn" @click="toConcat(item.contacts)">
							立即咨询
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				visitInfo: [1, 1, 1, 1, 1, 1, 1, 1]
			}
		},
		methods: {
			toConcat(contact) {
				if (!contact || contact.length < 1) {
					this.$util.Tips({
						title: '暂未获取到联系人'
					})
					return;
				}

				getApp().globalData.into_singleChatRoom(contact[0].contactPhone)
			},
		}
	}
</script>

<style lang="scss">
	// 供应链
	.supplychain {
		padding: 30rpx 0;

		.item {
			margin-bottom: 32rpx;
			border-radius: 10rpx;
			background: #ffffff;
			padding: 24rpx;
			overflow: hidden;

			.top-info {
				margin-bottom: 16rpx;
				font-size: 24rpx;
				font-weight: 400;
				color: rgba(191, 186, 186, 1);

				.close {
					font-size: 36rpx;
				}
			}

		}

		.item:last-child {
			margin-bottom: 0;
		}

		.sell-goods {
			.goods-img {
				width: 256rpx;
				height: 216rpx;
				border-radius: 10rpx;
				overflow: hidden;
				position: relative;
				background-color: #cccccc;

				.img {
					width: 100%;
					height: 100%;
				}

				.tag {
					padding: 0 6rpx;
					max-width: 356rpx;
					height: 36rpx;
					border-radius: 0px 10rpx 0px 10rpx;
					background: rgba(67, 207, 124, 1);
					font-size: 26rpx;
					font-weight: 500;
					color: rgba(255, 255, 255, 1);
					text-align: center;
					position: absolute;
					top: 0;
					left: 0;
				}

				.distance {
					width: 100%;
					padding: 12rpx;
					background: rgba(0, 0, 0, .3);
					font-size: 22rpx;
					font-weight: 400;
					color: rgba(255, 255, 255, 1);

					image {
						width: 14rpx;
						height: 18rpx;
						margin-right: 12rpx;
					}

					position: absolute;
					bottom: 0;
					left: 0;
				}
			}

			.goods-info {
				width: calc(100% - 268rpx);
				height: 216rpx;

				.title {
					width: 100%;
					font-size: 30rpx;
					font-weight: 500;
					color: rgba(56, 56, 56, 1);
				}

				.sell-price {
					font-size: 24rpx;
					font-weight: 400;
					color: rgba(238, 33, 45, 1);

					text {
						font-size: 36rpx;
						font-weight: 700;
					}
				}

				.gold-coin {
					width: 148rpx;
					max-width: 100%;
					padding: 4rpx 12rpx;
					// height: 36rpx;
					border-radius: 20rpx;
					background: rgba(255, 195, 0, 1);
					border: 1px solid rgba(255, 235, 59, 1);
					position: relative;

					image {
						width: 36rpx;
						height: 36rpx;
						position: absolute;
						left: 0;
						top: 0;
					}

					.num {
						margin-left: 36rpx;
						font-size: 28rpx;
						font-weight: 500;
						color: rgba(255, 255, 255, 1);
					}
				}

				.goods-tag {
					.tag {
						white-space: nowrap;
						border-radius: 4px;
						background: rgba(255, 232, 234, 1);
						padding: 6rpx 8rpx;
						margin-right: 12rpx;
						font-size: 24rpx;
						font-weight: 400;
						color: rgba(238, 33, 45, 1);
					}

					.tag:last-child {
						margin-right: 0;
					}
				}
			}
		}

		.visit-box {
			padding: 30rpx 0;
			margin-top: 30rpx;
			border-top: 1px solid rgba(238, 238, 238, 1);

			.visit-advtar-box {
				width: 70%;

				.visit-num {
					font-size: 24rpx;
					font-weight: 400;
					color: rgba(166, 166, 166, 1);
					margin-top: 26rpx;
				}

				.visit-advtar {
					width: 100%;
					height: 46rpx;
					position: relative;

					image {
						width: 46rpx;
						height: 46rpx;
						border-radius: 50%;
						position: absolute;
					}
				}
			}

			.visit-l {
				width: 30%;

				.visit-num {
					text-align: center;
					font-size: 24rpx;
					font-weight: 400;
					color: rgba(166, 166, 166, 1);
					margin-bottom: 12rpx;
				}

				.visit-btn {
					width: 200rpx;
					height: 60rpx;
					line-height: 60rpx;
					opacity: 1;
					border-radius: 30rpx;
					background: rgba(238, 33, 45, 1);
					text-align: center;
					font-size: 28rpx;
					font-weight: 400;
					color: rgba(255, 255, 255, 1);
				}
			}


		}
	}
</style>